﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataTienda
{
    public class PropertyValidationRule
    {
        /// <summary>
        /// Gets or sets the name of the property.
        /// </summary>
        /// <value>The name of the property.</value>
        public string PropertyName { get; set; }
        /// <summary>
        /// Gets or sets the validation rule.
        /// </summary>
        /// <value>The validation rule.</value>
        public ValidationRuleDelegate ValidationRule { get; set; }
        /// <summary>
        /// Gets or sets the error message.
        /// </summary>
        /// <value>The error message.</value>
        public string ErrorMessage { get; set; }
        /// <summary>
        /// Gets or sets the type of the error.
        /// </summary>
        /// <value>The type of the error.</value>
        public ErrorType ErrorType { get; set; }
        /// <summary>
        /// Gets or sets the arguments.
        /// </summary>
        /// <value>The arguments.</value>
        public object[] Args { get; set; }
    }

    /// <summary>
    /// Enum ErrorType
    /// </summary>
    public enum ErrorType
    {
        /// <summary>
        /// The required
        /// </summary>
        Required,
        /// <summary>
        /// The invalid format
        /// </summary>
        InvalidFormat,
        /// <summary>
        /// The numeric expected
        /// </summary>
        NumericExpected,
        /// <summary>
        /// The warning
        /// </summary>
        Warning
    }
}
